//
//  BX_Mjfresh.m
//  BiXuan
//
//  Created by ayi on 2018/8/6.
//  Copyright © 2018年 碧斯诺兰. All rights reserved.
//

#import "Custom_Mjfresh.h"

@implementation Custom_Mjfresh


+ (MJRefreshHeader *)mj_customMjfreshHeaderSetting:(void(^)(void))refreshingblock{
    return [Custom_Mjfresh mj_customMjfreshHeaderSetting:refreshingblock andHeaderType:BX_MjfreshHeader_DefaultHeader];
}

+ (MJRefreshHeader *)mj_customMjfreshHeaderSetting:(void(^)(void))refreshingblock andHeaderType:(BX_MjfreshHeaderType )headerType{
    MJRefreshHeader *header;
    switch (headerType) {
        case BX_MjfreshHeader_NormalHeader:
            header = [MJRefreshNormalHeader headerWithRefreshingBlock:refreshingblock];
            break;
        default:
        {
            header = [MJRefreshNormalHeader headerWithRefreshingBlock:refreshingblock];
            ((MJRefreshNormalHeader *)header).stateLabel.font = [UIFont systemFontOfSize:12];
            ((MJRefreshNormalHeader *)header).stateLabel.textColor = Common_TextLowColor;
            ((MJRefreshNormalHeader *)header).lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:12];
            ((MJRefreshNormalHeader *)header).lastUpdatedTimeLabel.textColor = Common_TextLowColor;
        }
            break;
    }
    return header;
} 

+ (MJRefreshFooter *)mj_customMjfreshFooterSetting:(void(^)(void))refreshingblock{
    return [Custom_Mjfresh mj_customMjfreshFooterSetting:refreshingblock andFooterType:BX_MjfreshFooter_DefaultFooter];
}

+ (MJRefreshFooter *)mj_customMjfreshFooterSetting:(void(^)(void))refreshingblock andFooterType:(BX_MjfreshFooterType )footerType{
    MJRefreshFooter *footer;
    switch (footerType) {
        case BX_MjfreshFooter_AutoNormalFooter:
            footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:refreshingblock];
            break;
        default:
        {
            footer= [MJRefreshBackStateFooter footerWithRefreshingBlock:refreshingblock];
            ((MJRefreshBackStateFooter *)footer).stateLabel.font = [UIFont systemFontOfSize:12];
            ((MJRefreshBackStateFooter *)footer).stateLabel.textColor = Common_TextLowColor;
            [((MJRefreshBackStateFooter *)footer) setTitle:@"我也是有底线的" forState: MJRefreshStateNoMoreData];
        }
            break;
    }
    return footer;
}

@end
